package com.monitor.system.service.impl;

import java.util.List;
import com.monitor.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.monitor.system.mapper.NodeUsageMapper;
import com.monitor.system.domain.NodeUsage;
import com.monitor.system.service.INodeUsageService;

/**
 * 备份节点Service业务层处理
 * 
 * @author monitor
 * @date 2024-06-11
 */
@Service
public class NodeUsageServiceImpl implements INodeUsageService 
{
    @Autowired
    private NodeUsageMapper nodeUsageMapper;

    /**
     * 查询备份节点
     * 
     * @param id 备份节点主键
     * @return 备份节点
     */
    @Override
    public NodeUsage selectNodeUsageById(Long id)
    {
        return nodeUsageMapper.selectNodeUsageById(id);
    }

    /**
     * 查询备份节点列表
     * 
     * @param nodeUsage 备份节点
     * @return 备份节点
     */
    @Override
    public List<NodeUsage> selectNodeUsageList(NodeUsage nodeUsage)
    {
        return nodeUsageMapper.selectNodeUsageList(nodeUsage);
    }

    /**
     * 新增备份节点
     * 
     * @param nodeUsage 备份节点
     * @return 结果
     */
    @Override
    public int insertNodeUsage(NodeUsage nodeUsage)
    {
        nodeUsage.setCreateTime(DateUtils.getNowDate());
        return nodeUsageMapper.insertNodeUsage(nodeUsage);
    }

    /**
     * 修改备份节点
     * 
     * @param nodeUsage 备份节点
     * @return 结果
     */
    @Override
    public int updateNodeUsage(NodeUsage nodeUsage)
    {
        nodeUsage.setUpdateTime(DateUtils.getNowDate());
        return nodeUsageMapper.updateNodeUsage(nodeUsage);
    }

    /**
     * 批量删除备份节点
     * 
     * @param ids 需要删除的备份节点主键
     * @return 结果
     */
    @Override
    public int deleteNodeUsageByIds(Long[] ids)
    {
        return nodeUsageMapper.deleteNodeUsageByIds(ids);
    }

    /**
     * 删除备份节点信息
     * 
     * @param id 备份节点主键
     * @return 结果
     */
    @Override
    public int deleteNodeUsageById(Long id)
    {
        return nodeUsageMapper.deleteNodeUsageById(id);
    }
}
